const schedule = require('node-schedule');
const _ = require('underscore');
const flowCalculation = require('./flow/flowCalculation');
const flowMonthCalculation = require('./flow/flowMonthCalculation');
const getSimMessage = require('./sim/getSimMessage');

/*const electricityCalculation = require('./energy/electricityCalculation');
const electricityCalculationCurrentMonth = require('./energy/electricityCalculationCurrentMonth');
const regionLightUpCalculation = require('./energy/regionLightUpCalculation');
const redisMemoryClear = require('./energy/redisMemoryClear');*/


function jobs() {
    schedule.scheduleJob('10 0 0 * * *', function () {
        flowCalculation();
    });
    schedule.scheduleJob('0 0 1 1 * *', function () {
        flowMonthCalculation();
    });
    schedule.scheduleJob('0 11 13 * * *', function () {
        getSimMessage();
    });

    //flowMonthCalculation();
    /*
        schedule.scheduleJob('0 0 1 * * *', function () {
            electricityCalculationCurrentMonth();
        });
        schedule.scheduleJob('0 0 1 * * *', function () {
            redisMemoryClear();
        });
        schedule.scheduleJob('0 30 7 * * *', function () {
            regionLightUpCalculation();
        });*/
}

let action = async function () {
    jobs();
};
module.exports = action;